import React from 'react'
import PropTypes from 'prop-types'

class Header2 extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            msg: "这是一个头部组件"
          };
    }
    render() {
        return (
            <div>
                <h2>----{this.props.title}----{this.props.num}----</h2>    
            </div>
        );
    }
}

Header2.defaultProps = {
    title: "默认标题"
}

Header2.propTypes = {
    num: PropTypes.number
}
export default Header2;